// @/utils/formatDateTime.js

export function isValidDate(dateString) {
  return /^\d{4}-\d{2}-\d{2}$/.test(dateString);
}

export function isValidTime(timeString) {
  return /^([01]\d|2[0-3]):([0-5]\d)$/.test(timeString);
}

export function ensureValidDate(dateString) {
  return isValidDate(dateString) ? dateString : null;
}

export function ensureValidTime(timeString) {
  return isValidTime(timeString) ? timeString : null;
}